import request from '@/utils/request'

// 获取员工列表
export const getEmployeeApi = params => request.get('/sys/user', { params })

// 导出excel
export const exportEmployExcelApi = () => request.get('/sys/user/export', {
  responseType:'blob'
})

// 获取导入excel模板
export const getImportTemplateApi = () => request.get('/sys/user/import/template', {
  responseType:'blob'
})

// 上传excel
export const uploadExcelApi = data => request.post('/sys/user/import', data)  

// 删除员工
export const delEmployeeApi = id => request.delete(`/sys/user/${id}`)

// 新增员工
export const addEmployeeApi = data => request.post('/sys/user', data)

// 查看员工详情
export const getEmployeeInfoApi = id => request.get(`/sys/user/${id}`)

// 修改员工
export const editEmployeeInfoApi = data => request.put(`/sys/user/${data.id}`, data)

// 获取可用的角色列表
export const getEnabledRoleListApi = () => request.get('/sys/role/list/enabled')

// 分配员工角色
export const assignRoleApi = data => request.put('/sys/user/assignRoles', data)
